<?php
	/* settings */
	session_start();
	$number_of_posts = 5; //5 at a time
	$_SESSION['posts_start'] = $_SESSION['posts_start'] ? $_SESSION['posts_start'] : $number_of_posts;

	/* loading of stuff */
	if(isset($_GET['start'])) {
		/* spit out the posts within the desired range */
		echo get_posts($_GET['start'],$_GET['desiredPosts']);
		/* save the user's "spot", so to speak */
		$_SESSION['posts_start']+= $_GET['desiredPosts'];
		/* kill the page */
		die();
	}
?>
<?php include('header.php'); ?>

	<style type="text/css">
		#posts-container			{ width:400px; border:1px solid #ccc; -webkit-border-radius:10px; -moz-border-radius:10px; }
		.post						{ padding:5px 10px 5px 100px; min-height:65px; border-bottom:1px solid #ccc; background:url(dwloadmore.png) 5px 5px no-repeat; cursor:pointer;  }
		.post:hover					{ background-color:lightblue; }
		a.post-title 				{ font-weight:bold; font-size:12px; text-decoration:none; }
		a.post-title:hover			{ text-decoration:underline; color:#900; }
		a.post-more					{ color:#900; }
		p.post-content				{ font-size:10px; line-height:17px; padding-bottom:0; }
		#load-more					{ background-color:#eee; color:#999; font-weight:bold; text-align:center; padding:10px 0; cursor:pointer; }
		#load-more:hover			{ color:#666; }
		.activate					{ background:url(loadmorespinner.gif) 140px 9px no-repeat #eee; }
	</style>
<!-- additional javascript hear -->
	<script type="text/javascript" src="<?=base_url();?>application/scripts/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="<?=base_url();?>application/scripts/jquery.scrollTo-1.4.2.js"></script>

</head>
<body>
<div id="wrapper">
<!-- menu -->
<?php include('menu.php'); ?>
<!-- end menu -->

<!-- navigator -->
<?php include('navigator.php'); ?>
<!-- nav end -->

 
 	<!-- Widget XHTML Starts Here -->
	<div id="posts-container">
		<!-- Posts go inside this DIV -->
		<div id="posts"></div>
		<!-- Load More "Link" -->
		<div id="load-more">Load More</div>
	</div>
	<!-- Widget XHTML Ends Here -->
<!-- footer -->
<?php include('footer.php');?>
<!-- footer end -->
</div>
</body>
</html>